package com.app.qbake.module.square.activity;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;

import com.wind.base.BaseActivity;
import com.wind.base.utils.Navigator;
import com.app.qbake.R;
import com.app.qbake.module.square.SearchGoodsListTabFragment;

import java.io.Serializable;

/**
 * Created by wind on 2018/10/28.
 */

public class SearchGoodsListActivity extends BaseActivity{

    private String keyword;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        SearchInfo searchInfo= Navigator.getSerializableExtra(this);
        keyword=searchInfo.keywords;
        setContentView(R.layout.fragment_container_with_toolbar);

        replaceFragment( SearchGoodsListTabFragment.getInstance(searchInfo.categoryId));
    }

    @Override
    protected void setTitle() {
        mTitleBar.setTitle(keyword);
    }

    public static void start(Activity activity, SearchInfo info) {
        Navigator.navigate(activity,SearchGoodsListActivity.class,info);
    }


    public static class SearchInfo implements Serializable{
        public String keywords;
        public String categoryId;
    }
}
